package com.jinzhi.api.task;

import com.jinzhi.jzweb.service.JazCoursesOrderService;
import com.jinzhi.jzweb.service.JazGroupOrderService;
import com.jinzhi.jzweb.service.JazGroupProdService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @Author: mcf
 * @CreateTime: 2024/06/21
 * @Description: 阿姨端定时器
 */

@Component
public class AuntTask {

    @Autowired
    private JazCoursesOrderService jazCoursesOrderService;

    @Autowired
    private JazGroupOrderService jazGroupOrderService;

    // 使用Cron表达式执行定时任务
    @Scheduled(cron = "0 0 0 * * ?") // 每天晚上12点触发
    //@Scheduled(fixedRate = 10 * 60 * 1000)//十分钟执行一次
//    @Scheduled(fixedRate = 60000)
    public void cronTask() {
        // 定时任务的逻辑处理
        jazCoursesOrderService.setDefaultComment();
    }

    @Scheduled(cron = "0 0 0 * * ?") // 每天晚上12点触发
    //@Scheduled(fixedRate = 10 * 60 * 1000)//十分钟执行一次
//    @Scheduled(fixedRate = 60000)
    public void setValid() {
        // 定时任务的逻辑处理
        jazGroupOrderService.setValid();
    }

}
